package com.pri.chat.activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.netease.nim.uikit.common.media.imagepicker.adapter.vh.SectionModel;
import com.netease.nim.uikit.net.SharedHelper;
import com.netease.nim.uikit.net.StatusBarUtil;
import com.netease.nim.uikit.net.entity.BannerBean;
import com.netease.nim.uikit.net.entity.BannerModel;
import com.netease.nim.uikit.net.entity.BaseBean;
import com.netease.nim.uikit.net.entity.NoticeUnreadNumber;
import com.netease.nim.uikit.net.rxjava.HttpMethods;
import com.netease.nim.uikit.net.subscribers.ProgressSubscriber;
import com.netease.nim.uikit.net.subscribers.SubscriberOnNextListener;
import com.pri.chat.MainActivity;
import com.pri.chat.R;
import com.pri.chat.application.APP;
import com.pri.chat.bean.KeyAndValueEntity;
import com.pri.chat.database.greendao.KeyAndValueEntityDao;
import com.pri.chat.utils.Des3Util;
import com.pri.chat.view.ImageViewPlus;
import com.vondear.rxtool.RxActivityTool;

import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

import okhttp3.MediaType;
import okhttp3.RequestBody;


public class DaoHangActivity extends AppCompatActivity {
    private SharedHelper sharedHelper;
    private Context mContext;

    private ImageViewPlus img;
    private TextView name;
    private TextView fbBtn;
    private TextView tgBtn;
    private boolean isFinish = false;
    private  boolean isFirst;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        StatusBarUtil.setDarkMode(this);
        Log.i("time:Wel", System.currentTimeMillis() + "");
        //禁止锁屏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
//        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明导航栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        setContentView(R.layout.activity_daohang);
        mContext = this;
        img = findViewById(R.id.img);
        name = findViewById(R.id.name);
        fbBtn = findViewById(R.id.fbBtn);
        tgBtn = findViewById(R.id.tgBtn);

        fbBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putString("type","1");
                RxActivityTool.skipActivity(mContext,ReleaseWishAcctivity.class,bundle);
                finish();
            }
        });

        tgBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RxActivityTool.skipActivity(mContext,MainActivity.class);
                finish();
            }
        });
        SharedHelper.saveKeyValueForString(mContext,"showWish","1");
    }

    @Override
    protected void onResume() {
        super.onResume();
        name.setText("HI！"+SharedHelper.readNick(mContext));
        Glide.with(mContext).load(SharedHelper.readHeadPic(mContext)).into(img);
    }
}
